package com.mybatisplus.sunpineshop.works.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mybatisplus.sunpineshop.works.entity.SUser;
import com.mybatisplus.sunpineshop.works.mapper.SUserMapper;
import com.mybatisplus.sunpineshop.works.service.SUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-02-25
 */
@Service
@Primary
public class SUserServiceImpl extends ServiceImpl<SUserMapper, SUser> implements SUserService {

    @Autowired
    private SUserMapper sUserMapper;

    public IPage<SUser> getUserList(Integer curNum,Integer pageSize){
        IPage<SUser> userPage = new Page<>(curNum, pageSize);//参数一是当前页，参数二是每页个数
        userPage = sUserMapper.selectPage(userPage, null);
        return userPage;
    }
}
